<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="authz" uri="http://acegisecurity.org/authz" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html; charset=UTF-8" %>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <title>Dayve web</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <link href="/common/css/style.css" rel="stylesheet" type="text/css"/>
    <link href="/common/css/calendar.css" rel="stylesheet" type="text/css"/>


    <script type="text/javascript" src="/common/js/common.js"></script>
    <script type="text/javascript" src="/common/js/data.js"></script>
    <script type='text/javascript' src="/common/dwr/engine.js"></script>
    <script type='text/javascript' src="/common/dwr/util.js"></script>

    <script type="text/javascript" src="/common/js/calendar.js"></script>

    <script type="text/javascript">
        // Locale 설정을 바꾼다.
        function jsChangeLocaleKR() {
            var TheForm = document.frm;
            TheForm.nextTarget.value = "index";
            TheForm.action = "${pageContext.request.contextPath}/changeLocale.do?language=kr";
            TheForm.submit();
        }

        function jsChangeLocaleEN() {
            var TheForm = document.frm;
            TheForm.nextTarget.value = "index";
            TheForm.action = "${pageContext.request.contextPath}/changeLocale.do?language=en";
            TheForm.submit();
        }

        function jsChangeLocaleZH() {
            var TheForm = document.frm;
            TheForm.nextTarget.value = "index";
            TheForm.action = "./changeLocale.do?language=zh";
            TheForm.action = "${pageContext.request.contextPath}/changeLocale.do?language=zh";
            TheForm.submit();
        }

        // Board List 페이지로 이동한다.
        function jsBoardList() {
            var TheForm = document.frm;
            TheForm.nextTarget.value = "list";	// page name
            TheForm.action = "./getBoardListBySearchword.do";
            TheForm.submit();
        }

        // 회원탈퇴
        function jsDeleteMember() {
            var TheForm = document.frm;
            TheForm.nextTarget.value = "index";	// page name
            TheForm.action = "./deleteMemberById.do";
            alert('<spring:message code="updateMember.jsDeleteMember" />');
            TheForm.submit();
        }

        // 회원정보 수정
        function jsUpdateMember() {
            var TheForm = document.frm;
            TheForm.nextTarget.value = "updateMember";	// page name
            TheForm.action = "./updateMemberById.do";
            TheForm.submit();
        }

        // 회원정보 수정 액션
        function jsUpdateAction() {
            var TheForm = document.frm;

            if(trim(TheForm.country.value) == ""){
                alert("<spring:message code="updateMember.selectNation" />");
                TheForm.country.focus();
            }else{
                if(confirm('<spring:message code="updateMember.confirmModify" />')){
                    TheForm.nextTarget.value = "intro";	// page name
                    TheForm.action = "./updateAction.do";
                    TheForm.submit();

                }
            }
        }

        // Community Board List 페이지로 이동한다.
        function jsCommunityBoardList() {
            var TheForm = document.menuFrm;
            TheForm.nextTarget.value = "communityBoardList";	// page name
            TheForm.action = "./communityBoardList.do";
            TheForm.submit();
        }

        // Photo Board List 페이지로 이동한다.
        function jsPhotoBoardList() {
            var TheForm = document.menuFrm;
            TheForm.nextTarget.value = "photoBoardList";	// page name
            TheForm.action = "./photoBoardList.do";
            TheForm.submit();
        }

        // Notice Board List 페이지로 이동한다.
        function jsNoticeBoardList() {
            var TheForm = document.menuFrm;
            TheForm.nextTarget.value = "noticeBoardList";	// page name
            TheForm.action = "./noticeBoardList.do";
            TheForm.submit();
        }

        // Contact Us 페이지로 이동한다.
        function jsContactUs() {
            var TheForm = document.menuFrm;
            TheForm.nextTarget.value = "contactus";	// page name
            TheForm.action = "./contactus.do";
            TheForm.submit();
        }

        // FAQ 페이지로 이동한다.
        function jsFAQ() {
            var TheForm = document.menuFrm;
            TheForm.nextTarget.value = "faq";	// page name
            TheForm.action = "./faq.do";
            TheForm.submit();
        }

    </script>
</head>

<body>
<div id="wrapper">
    <!------------------------------ top 시작-------------------------------------->
    <%@include file="header.jsp" %>
    <!------------------------------ top 끝-------------------------------------->
    <div class="sub_content">
        <form name="frm" method="POST" onsubmit="return false;">
            <input type="hidden" name="nextTarget" value="">
            <input type="hidden" name="id" value=${member.id}>
            <img src="/images/intro/sub_title06.gif" />
            <p class="contactus">
                <spring:message code="updateMember.passInfo" />
            </p>
            <table class="mypage_tb">
                <tr>
                    <td class="mypage_label"><spring:message code="updateMember.id" /></td>
                    <td class="mypage_data">${member.id}</td>
                </tr>
                <tr>
                    <td class="mypage_label"><spring:message code="updateMember.email" /></td>
                    <td class="mypage_data"><input type="text" name="email" value="${member.email}" class="mypage_input" /></td>
                </tr>
                <tr>
                    <td class="mypage_label"><spring:message code="updateMember.openEmail" /></td>
                    <td class="mypage_data"><input type="checkbox" name="open_email_yn" value="Y"  <c:if test="${member.open_email_yn == 'Y'}"> checked </c:if>/></td>
                </tr>
                <tr>
                    <td class="mypage_label"><spring:message code="updateMember.phone" /></td>
                    <td class="mypage_data"><input type="text" name="mobile_phone_number" value="${member.mobile_phone_number}" class="mypage_input" /></td>
                </tr>
                <tr>
                    <td class="mypage_label"><spring:message code="updateMember.openPhone" /></td>
                    <td class="mypage_data"><input type="checkbox" name="open_mobile_phone_yn" value="Y" <c:if test="${member.open_mobile_phone_yn == 'Y'}"> checked </c:if>/></td>
                </tr>
                <tr>
                    <td class="mypage_label"><spring:message code="updateMember.nick" /></td>
                    <td class="mypage_data"><input type="text" name="nick_name" value="${member.nick_name}" class="mypage_input" /></td>
                </tr>
                <tr>
                    <td class="mypage_label"><spring:message code="updateMember.openNick" /></td>
                    <td class="mypage_data"><input type="checkbox" name="open_nick_name_yn" value="Y" <c:if test="${member.open_nick_name_yn == 'Y'}"> checked </c:if>/></td>
                </tr>
                <tr>
                    <td class="mypage_label"><spring:message code="updateMember.nation" /></td>
                    <td class="mypage_data">
                        <select size="1" name="country">
                            <option value="" <c:if test="${member.country == ''}">
                                selected</c:if>><spring:message code="updateMember.selectNation" /></option>
                            <c:forEach items="${countryList}" var="countryList" varStatus="serviceStatus" begin="0" end="${countryTotalCount}"
                                       step="1">
                                <option value="${countryList.country_code}" <c:if test="${member.country == countryList.country_code}">
                                    selected</c:if>>${countryList.country_ko}</option>
                            </c:forEach>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="mypage_label"><spring:message code="updateMember.openNation" /></td>
                    <td class="mypage_data"><input type="checkbox" name="open_country_yn" value="Y" <c:if test="${member.open_country_yn == 'Y'}"> checked </c:if>/></td>
                </tr>
                <tr>
                    <td class="mypage_label"><spring:message code="updateMember.homepage" /></td>
                    <td class="mypage_data"><input type="text" name="home_page" value="${member.home_page}" class="mypage_input" /></td>
                </tr>
                <tr>
                    <td class="mypage_label"><spring:message code="updateMember.openHomepage" /></td>
                    <td class="mypage_data"><input type="checkbox" name="open_home_page_yn" value="Y" <c:if test="${member.open_home_page_yn == 'Y'}"> checked </c:if>/></td>
                </tr>
                <tr>
                    <td class="mypage_label"><spring:message code="updateMember.birth" /></td>
                    <td class="mypage_data">
                        <input type="text" name="birthday" value="${member.birthday}" class="mypage_input" readonly />
                        <img src="/images/button.gif" onMouseUp="showCalendar('calendar', 'frm.birthday', this)" id="button" name="button" style="cursor:pointer" align=absmiddle>
                        <div id="calendar" style="position:absolute;"></div>
                    </td>
                </tr>
                <tr>
                    <td class="mypage_lastlabel"><spring:message code="updateMember.sex" /></td>
                    <td class="mypage_data">
                        <input type="radio" name="sex" value="MALE" <c:if test="${member.sex == 'MALE'}"> checked </c:if>/>
                        남
                        <input type="radio" name="sex" value="FEMALE" <c:if test="${member.sex == 'FEMALE'}"> checked </c:if>/>
                        여
                        <input type="radio" name="sex" value="ETC" <c:if test="${member.sex == 'ETC'}"> checked </c:if>/>
                        기타</td>
                </tr>
            </table>
            <!---------------------------------------- 버튼 -------------------------------------->
            <div class="content_center">
                <a href="intro.do"><img src="/images/intro/btn_gomain.gif" /></a>
                <a href="javascript:jsUpdateAction()"><img src="/images/intro/btn_modify.gif" /></a>
            </div>
        </form>
    </div>
    <!------------------------------ 하위메뉴 시작-------------------------------------->
    <%@include file="footer.jsp" %>
    <!------------------------------ 하위메뉴 끝-------------------------------------->
</div>
</body>
</html>
